import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import About from '../views/About.vue'

import goods from "./goods";
import operation from "./operation";
import promotion from "./promotion";
import system from "./system";
import dashboard from '../views/About2.vue'

Vue.use(VueRouter)

const routes = [{
		path: "/",
		redirect: "/Home"
	},
	{
		path: "/Home",
		component: Home
	},
	{
		path: "/About",
		component: About,
		redirect: '/dashboard',
		children: [{
			path: '/dashboard',
			component: dashboard,
			meta: {
				title1: '首页'
			}
		}]

	},
	operation,
	goods,
	promotion,
	system,
]
const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error=> error)
}
const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
